<%--
 *  File:    PrivListDetailJumpSingle.jsp
 *  @Author: Kent Zhong
 *  Date:    2002/05/31
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.OvalLabel" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom-tag.tld" prefix="custom" %>
<%
  //init param
  Category cat = Category.getInstance("jsp.PrivListDetailJumpSingle"); 
   
  String strModuleName = "UPM";
  String strTableName = "ovauthorityprivilege";
  String privilegeCode = "Z0102";
  
  HashMap userinfo = (HashMap)session.getAttribute("userinfo");
  
  cat.debug("The userinfo is :"+userinfo);
  cat.info("enter my page");
  
  
%>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>Add</title>
<PageFlow:CheckPageFlow pageName="privlistdetailjumpsingle"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<script language="JavaScript">

    function page_summary(actionvalue,orderbyname)
    {
      var editform = summaryPrepare(userauthorityconditionform,actionvalue,orderbyname);
      editform.action = "PrivListDetailJumpSingle.jsp?<%= OvalTools.randomURL() %>";
      editform.target = "_self";
      isRunning = true;
      editform.submit();  
    }
    function page_radiotrue(selid ,selnum)
    {
        radiotrue(selid);
        with(document.userauthorityconditionform)
        {
            objselid=eval("privilegeid"+selnum);
            objselcode=eval("privilegecode"+selnum);
            objselname=eval("privilegename"+selnum);
            privilegeid.value=objselid.value;
            privilegecode.value=objselcode.value;
            privilegename.value=objselname.value;
        }
    }
    function page_done()
    {
        var id=document.userauthorityconditionform.privilegeid.value;
        var code=document.userauthorityconditionform.privilegecode.value;
        var name=document.userauthorityconditionform.privilegename.value;
        opener.pop_selectpriv(id,code,name);
    }
<%--[SCRIPT]    [SCRIPT]--%>
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="userauthorityconditionform" method="post" action="../../Dispatcher"  target="_parent">
    <input type="hidden" name="pagename" value="userauthoritycondition">
    <input type="hidden" name="actionname">   
    <input type="hidden" name="languagecode" value="<%=JspHelper.filterNull( session.getAttribute("languagecode") )%>">   
<%
    Integer IntUserId=(Integer)pageContext.getAttribute("userid");
    if(IntUserId==null)
        IntUserId=new Integer(-1);
    
 %>
 <input  type=hidden name=userid value="<%=JspHelper.filterNull(IntUserId.intValue())%>">
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
  <%--form name="form1" method="post" action="PrivListDetailJump.htm"--%>
    <tr> 
      <td valign="top"> 
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td colspan="2" class="summary_top"></td>
          </tr>
          <%@ include file="/inc/SummarySearch.inc" %>
          <tr> 
            <td height="5" colspan="2" class="summary_top"></td>
          </tr>
        </table>
        <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
          <tr class="deepblue-left" > 
            <td width="5%" class="title_center">&nbsp;</td>
            <td class="title_center"><%=label.getLabelName("L_PrivilegeCode")%></td>
            <td class="title_center"><%=label.getLabelName("L_PrivilegeName")%></td>
            <td class="title_center"><%=label.getLabelName("L_PrivilegeType")%></td>
          </tr>
          <%
            Vector allprivilege=(Vector)pageContext.getAttribute("allprivilege");
            if(allprivilege==null)
                allprivilege=new Vector();
            cat.debug("allprivilege is :"+allprivilege);
            String strClassType="";
            Integer nDefaultId = new Integer(-1);
            String strDefaultCode="";
            String strDefaultPrivNmae="";
            
            String strChecked = "";
            boolean bHasChecked = false;
            int i=0;
          %>
          <logic:iterate id="allprivilegeitem" collection="<%= allprivilege %>">
          <%
            if(i%2 == 1)
            {
              	strClassType = "td-listrom";
            }else{                    
              	strClassType = "";
            }
            if(!bHasChecked)
            {
              nDefaultId = (Integer)((HashMap)pageContext.getAttribute("allprivilegeitem")).get("privilegeid");
              strDefaultCode=(String)((HashMap)pageContext.getAttribute("allprivilegeitem")).get("privilegecode");
              strDefaultPrivNmae=(String)((HashMap)pageContext.getAttribute("allprivilegeitem")).get("privilegename");
              bHasChecked = true;
              strChecked = "Checked";
            }
            else
            {
              strChecked = "";
            }
            i++;
          %>
          <input type=hidden name=privilegecode<%=JspHelper.filterNull(i)%> value='<oval:write name="allprivilegeitem" property="privilegecode" />'>
          <input type=hidden name=privilegename<%=JspHelper.filterNull(i)%> value='<oval:write name="allprivilegeitem" property="privilegename" />'>
          
          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'" onClick="javascript:page_radiotrue('privilegeid<%=JspHelper.filterNull(i)%>','<%=JspHelper.filterNull(i)%>' )" class="<%=JspHelper.filterNull( strClassType )%>"> 
            <td> 
              <input type="radio" id="privilegeid<%=JspHelper.filterNull(i)%>" name="privids" value='<oval:write name="allprivilegeitem" property="privilegeid" />' class="normalradio" <%=JspHelper.filterNull(strChecked)%>>
            </td>
            <td>&nbsp;<oval:write name="allprivilegeitem" property="privilegecode" /></td>
            <td >&nbsp;<oval:write name="allprivilegeitem" property="privilegename" /></td>
            <td >&nbsp;<oval:write name="allprivilegeitem" property="privilegetype" /></td>
          </tr>
          </logic:iterate>
            <input type=hidden name=privilegeid value='<%=JspHelper.filterNull(nDefaultId)%>'>
            <input type=hidden name=privilegecode value='<%=JspHelper.filterNull(strDefaultCode)%>'>
            <input type=hidden name=privilegename value='<%=JspHelper.filterNull(strDefaultPrivNmae)%>'>

          <tr> 
            <td colspan="4"> 
              <table width="100%" cellspacing="0" border="0">
                <%@ include file="/inc/SummaryActionPop.inc" %>
              </table>
            </td>
          </tr>
        </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
          <tr> 
            <td class="td_center">
            <a onclick="page_done();"><custom:button type="1" label="L_Add" imgsrc="add.gif" border="0" style="width:60"/></a></td>
          </tr>
        </table>
      </td>
    </tr>
  
</table>
</form>
</body>
</html>


